package com.jordi.tetris.model;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.List;

public abstract class Observable {

	private List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
	
	public void addObserver(PropertyChangeListener listener) {
		listeners.add(listener);
	}
	
	protected void notifyObservers() {
		for (PropertyChangeListener pcl : listeners) {
			pcl.propertyChange(new PropertyChangeEvent(this, null, null, null));
		}
	}
}
